package com.itec.learn.java.design.factory.nomethod;

import com.itec.learn.java.design.factory.CheesePizza;
import com.itec.learn.java.design.factory.GreekPizza;
import com.itec.learn.java.design.factory.Pizza;
import com.itec.learn.java.design.factory.SimplePizza;

/**
 * @author chenyiqun
 */
public class ChicagoPizzaFactory extends AbstractPizzaFactory{
    public Pizza createPizza(String type){
        Pizza pizza;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        } else if (type.equals("greek")){
            pizza = new GreekPizza();
        } else {
            pizza = new SimplePizza();
        }
        pizza.setType(type);
        pizza.setStyle("芝加哥");
        return pizza;
    }
}
